#include "gtkcssproviderprivate.h"
#include "gtkbitmaskprivate.h"
+#include "gtkcssstylefuncsprivate.h"
#include "gtkcssparserprivate.h"
#include "gtkcsssectionprivate.h"
#include "gtkcssselectorprivate.h"
gtk_css_section_get_file (val->section),
g_value_get_string (&val->value));
- found = _gtk_style_property_parse_value (NULL,
- value,
- scanner->parser,
- NULL);
+ found = _gtk_css_style_parse_value (value,
+ scanner->parser,
+ NULL);
gtk_css_scanner_destroy (scanner);
#include <math.h>
#include "gtkborderimageprivate.h"
+#include "gtkcssstylefuncsprivate.h"
#include "gtkcsstypesprivate.h"
/* this is in case round() is not provided by the compiler,
g_value_init (&temp, CAIRO_GOBJECT_TYPE_PATTERN);
- if (!_gtk_style_property_parse_value (NULL, &temp, parser, base))
+ if (!_gtk_css_style_parse_value (&temp, parser, base))
return FALSE;
boxed_type = G_VALUE_TYPE (&temp);
g_value_unset (&temp);
g_value_init (&temp, GTK_TYPE_BORDER);
- if (!_gtk_style_property_parse_value (NULL, &temp, parser, base))
+ if (!_gtk_css_style_parse_value (&temp, parser, base))
goto out;
parsed_slice = g_value_get_boxed (&temp);
g_value_unset (&temp);
g_value_init (&temp, GTK_TYPE_BORDER);
- if (!_gtk_style_property_parse_value (NULL, &temp, parser, base))
+ if (!_gtk_css_style_parse_value (&temp, parser, base))
goto out;
width = g_value_dup_boxed (&temp);
g_value_unset (&temp);
g_value_init (&temp, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT);
- if (!_gtk_style_property_parse_value (NULL, &temp, parser, base))
+ if (!_gtk_css_style_parse_value (&temp, parser, base))
goto out;
parsed_repeat = g_value_get_boxed (&temp);
GtkCssParser *parser,
GFile *base)
{
+ g_return_val_if_fail (GTK_IS_STYLE_PROPERTY (property), FALSE);
g_return_val_if_fail (value != NULL, FALSE);
g_return_val_if_fail (parser != NULL, FALSE);
- if (property)
+ if (_gtk_css_parser_try (parser, "initial", TRUE))
{
- if (_gtk_css_parser_try (parser, "initial", TRUE))
- {
- /* the initial value can be explicitly specified with the
- * ‘initial’ keyword which all properties accept.
- */
- g_value_unset (value);
- g_value_init (value, GTK_TYPE_CSS_SPECIAL_VALUE);
- g_value_set_enum (value, GTK_CSS_INITIAL);
- return TRUE;
- }
- else if (_gtk_css_parser_try (parser, "inherit", TRUE))
- {
- /* All properties accept the ‘inherit’ value which
- * explicitly specifies that the value will be determined
- * by inheritance. The ‘inherit’ value can be used to
- * strengthen inherited values in the cascade, and it can
- * also be used on properties that are not normally inherited.
- */
- g_value_unset (value);
- g_value_init (value, GTK_TYPE_CSS_SPECIAL_VALUE);
- g_value_set_enum (value, GTK_CSS_INHERIT);
- return TRUE;
- }
- else if (property->property_parse_func)
- {
- GError *error = NULL;
- char *value_str;
- gboolean success;
-
- value_str = _gtk_css_parser_read_value (parser);
- if (value_str == NULL)
- return FALSE;
-
- success = (*property->property_parse_func) (value_str, value, &error);
-
- g_free (value_str);
-
- return success;
- }
-
- if (property->parse_func)
- return (* property->parse_func) (parser, base, value);
+ /* the initial value can be explicitly specified with the
+ * ‘initial’ keyword which all properties accept.
+ */
+ g_value_unset (value);
+ g_value_init (value, GTK_TYPE_CSS_SPECIAL_VALUE);
+ g_value_set_enum (value, GTK_CSS_INITIAL);
+ return TRUE;
}
-
- return _gtk_css_style_parse_value (value, parser, base);
+ else if (_gtk_css_parser_try (parser, "inherit", TRUE))
+ {
+ /* All properties accept the ‘inherit’ value which
+ * explicitly specifies that the value will be determined
+ * by inheritance. The ‘inherit’ value can be used to
+ * strengthen inherited values in the cascade, and it can
+ * also be used on properties that are not normally inherited.
+ */
+ g_value_unset (value);
+ g_value_init (value, GTK_TYPE_CSS_SPECIAL_VALUE);
+ g_value_set_enum (value, GTK_CSS_INHERIT);
+ return TRUE;
+ }
+ else if (property->property_parse_func)
+ {
+ GError *error = NULL;
+ char *value_str;
+ gboolean success;
+
+ value_str = _gtk_css_parser_read_value (parser);
+ if (value_str == NULL)
+ return FALSE;
+
+ success = (*property->property_parse_func) (value_str, value, &error);
+
+ g_free (value_str);
+
+ return success;
+ }
+ else if (property->parse_func)
+ return (* property->parse_func) (parser, base, value);
+ else
+ return _gtk_css_style_parse_value (value, parser, base);
}
GParameter *